package com.example.javabasic.thread.classtwo.future.demo1;

public class Test {
    public static void main(String[] args) throws InterruptedException {
        //创建future
        FutureService futureService = new FutureService();
        Future<String> future = futureService.submit(() -> {
            try {
                Thread.sleep(3000);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
            return "Over";
        },System.out::println);
//        System.out.println("---------------");
//        System.out.println(future.get());;
    }

}
